package com.jsdxsys.dao.impl;
import java.io.IOException;
import java.io.Reader;
import java.util.List;

import org.apache.ibatis.io.Resources;
import org.apache.ibatis.session.SqlSession;
import org.apache.ibatis.session.SqlSessionFactory;
import org.apache.ibatis.session.SqlSessionFactoryBuilder;

import com.jsdxsys.entity.Admin;
public class MyBatisUtils {
	static SqlSessionFactory factory=null;
public static SqlSessionFactory createFactory() throws IOException{
	if(factory!=null) {
		return factory;
	}

	 String resource = "mybatis/Configuration.xml";
    	Reader reader;
		
				reader = Resources.getResourceAsReader(resource);
		       factory= new SqlSessionFactoryBuilder().build(reader);



	 return factory;
}
}
